package com.ch.dubbodemo.business;

import com.alibaba.dubbo.config.annotation.Reference;
import com.ch.dubbodemo.api.HelloService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;


import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class DubboDemoApplication {

	private final Logger logger = LoggerFactory.getLogger(getClass());

	@Reference(version = "1.0.0")
	private HelloService helloService;

	public static void main(String[] args) {

		SpringApplication.run(DubboDemoApplication.class, args);
	}

	@Bean
	public ApplicationRunner runner(){
		return args -> {
			System.out.println("---------------------------");
			logger.info(helloService.sayHello("hhhhhhhh!!!!"));
		};
	}
	
}
